package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.impl.ShopServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/shop")
public class ShopController {

    @Autowired
    private ShopServiceImpl shopService;

    @PutMapping("/{status}")
    public Result setShopStatus(@PathVariable Integer status){
        shopService.setShopStatus(status);
        return Result.success();
    }

    @GetMapping("/status")
    public Result<Integer> getShopStatus(){
        return Result.success(shopService.getShopStatus());
    }
}
